-- local ServerOHOH = _G.ServerOHOH;
-- local M = ServerOHOH.class.new(script, ServerOHOH.files.BaseComponent());
-- local Trailing_Cfg=ServerOHOH.config.Trailing
-- local Gloves_Cfg=ServerOHOH.config.Gloves

-- function M.new(self,...)
-- 	return M(self,...);
-- end;

-- function M.ctor(self, parent)
-- 	M.super.ctor(self, parent);
-- 	self.Database= self.parent.player:GetComponent(ServerOHOH.load.Server_PlayerDataComponent());

--     -- local att1=self.parent.main_inst:WaitForChild("LeftUpperArm")
--     -- if  not att1 then
        
--     --     warn("----No---LeftUpperArm------->",self.parent.main_inst)
        
--     -- end
-- 	-- self.TrailLeftAtt=Instance.new("Attachment",ServerOHOH:GetPath_Loop("HumanoidRootPart",self.parent.main_inst))
--     -- self.TrailLeftAtt.Position=Vector3.new(-0.8,0,0)
-- 	-- self.TrailRightAtt=Instance.new("Attachment",ServerOHOH:GetPath_Loop("HumanoidRootPart",self.parent.main_inst))
--     -- self.TrailRightAtt.Position=Vector3.new(0.8,0,0)

--     self.TrailLeftAtt=Instance.new("Attachment", self.parent:WaitForChild_Loop("HumanoidRootPart"))
--     self.TrailLeftAtt.Position=Vector3.new(-0.8,0,0)
-- 	self.TrailRightAtt=Instance.new("Attachment", self.parent:WaitForChild_Loop("HumanoidRootPart"))
--     self.TrailRightAtt.Position=Vector3.new(0.8,0,0)


--     self:UpdateTrailing()
--     self:UpdateGlove()
-- end;

-- function M.dtor(self)
-- 	M.super.dtor(self);
-- end;


-- function M.UpdateTrailing(self)

--     if self.Trail then
--         self.Trail:Destroy()
--         self.Trail=nil
--     end

--     local eqid=self.Database:GetData("trail").equip
--     if eqid and Trailing_Cfg[eqid] then
--         local trail=ServerOHOH:GetPath_Loop(Trailing_Cfg[eqid].path..".Part.Trail",game.ReplicatedStorage.Resource.Trailing):Clone()
--         trail.Parent=self.TrailLeftAtt
--         trail.Attachment0=self.TrailLeftAtt
--         trail.Attachment1=self.TrailRightAtt
--         self.Trail=trail
--     end
-- end

-- function M.UpdateGlove(self)

--     if self.GloveLeft then
--         self.GloveLeft:Destroy()
--         self.GloveLeft=nil
--     end

--     if self.GloveRight then
--         self.GloveRight:Destroy()
--         self.GloveRight=nil
--     end


--     local eqid=self.Database:GetData("glove").equip
--     if eqid and Gloves_Cfg[eqid] then
--         self.GloveLeft=ServerOHOH:GetPath_Loop(Gloves_Cfg[eqid].perfab..".Part",game.ReplicatedStorage.Resource.Gloves):Clone()
--         self.GloveLeft.Parent=self.parent.main_inst
--         self.GloveLeft.Name="WeaponLeft"

--         -- self.GloveRight=self.GloveLeft:Clone()
--         -- self.GloveRight.Parent=self.parent.main_inst
--         -- self.GloveRight.Name="WeaponRight"

--         self:UpdateWeaponState(1)


--         -- local rightCf=self.parent.main_inst.RightHand.CFrame

--         -- -- self.GloveRight.CFrame=rightCf+self.GloveLeft.pos.position
--         -- self.GloveRight.CFrame=rightCf:ToWorldSpace(self.GloveRight.R.CFrame)

--         -- local w2=Instance.new("WeldConstraint",self.GloveRight)
--         -- w2.Part0=self.GloveRight
--         -- w2.Part1=self.parent.main_inst.RightHand

--     end
-- end

-- --0 背在背上，1 拿在手上
-- function M.UpdateWeaponState(self,state)
--     if self.WpWeld then
--         self.WpWeld:Destroy()
--         self.WpWeld=nil
--     end
--     if state==0 then
--         local rearCf=self.parent.main_inst.UpperTorso.CFrame
--         self.GloveLeft.CFrame=rearCf:ToWorldSpace(self.GloveLeft.rear.CFrame)
--         self.WpWeld=Instance.new("WeldConstraint",self.GloveLeft)
--         self.WpWeld.Part0=self.GloveLeft
--         self.WpWeld.Part1=self.parent.main_inst.UpperTorso
--         self.WpWeld.Name="WP"

--     else
    
--         local leftCf=self.parent.main_inst.LeftHand.CFrame
--         self.GloveLeft.CFrame=leftCf:ToWorldSpace(self.GloveLeft.leftHand.CFrame)
--         self.WpWeld=Instance.new("WeldConstraint",self.GloveLeft)
--         self.WpWeld.Part0=self.GloveLeft
--         self.WpWeld.Part1=self.parent.main_inst.LeftHand
--         self.WpWeld.Name="WP"



--     end
-- end

-- function M.AddBattleSuit(self)

--     if self.BattleSuit then
--         return
--     end

--     self.BattleSuit=ServerOHOH:GetPath_Loop("cloak",game.ReplicatedStorage.Resource):Clone()
--     self.BattleSuit.Parent=self.parent.main_inst
--     self.BattleSuit.CFrame=self.parent.main_inst.UpperTorso.NeckAttachment.WorldCFrame
--     local w1=Instance.new("WeldConstraint",self.BattleSuit)
--     w1.Part0=self.BattleSuit
--     w1.Part1=self.parent.main_inst.UpperTorso

-- end


-- function M.RemoveDattleSuit(self)

--     if self.BattleSuit then
--         self.BattleSuit:Destroy()
--         self.BattleSuit=nil
--     end

-- end

-- return M